﻿using System;

namespace duia.Canteenpay.Domain.DomainObject
{
    /// <summary>
    /// 菜品
    /// </summary>
    public class Dishes : BaseEntity, IAggregateRoot
    {

        #region 成员变量

        /// <summary>
        /// 菜品名字
        /// </summary>
        public string DishesName { get; private set; }

        /// <summary>
        /// 菜品条码
        /// </summary>
        public string DishesCode { get; private set; }

        /// <summary>
        /// 菜品分类Id
        /// </summary>
        public Guid DishesCategoryKeyId { get; private set; }

        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price { get; private set; }

        /// <summary>
        /// 展示图
        /// </summary>
        public string ShowImageUrl { get; private set; }


        #endregion

        public Dishes(string dishesName, string dishesCode, Guid dishesCategoryKeyId, decimal price, string showImageUrl)//,Guid? keyId = null
        {
            //if (keyId.HasValue) base.SetKeyId(keyId.Value);
            this.DishesName = !string.IsNullOrEmpty(dishesName) ? dishesName : throw new ArgumentNullException(nameof(dishesName));
            this.DishesCode = !string.IsNullOrEmpty(dishesCode) ? dishesCode : throw new ArgumentNullException(nameof(dishesCode));
            this.DishesCategoryKeyId = !Guid.Empty.Equals(dishesCategoryKeyId) ? dishesCategoryKeyId : throw new ArgumentNullException(nameof(dishesCategoryKeyId));
        }



    }
}
